package com.zgjkhis.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zgjkhis.domain.BaseDomain;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;

/**
* @date 2020-05-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("conversion_factor")
public class ConversionFactor extends BaseDomain {

    /** ID */
    @TableId
    private Long id;

    /** 系数名称 */
    @NotBlank(message = "系数名称")
    private String name;

    private Double coefficient;

    public void copy(ConversionFactor source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
